<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
  <title>编辑学生</title>
  <style>
    /* 设置背景图片 */
    body {
      margin: 0;
      padding: 0;
      background-image: url('img/sky.jpg'); /* 替换为你的图片路径 */
      background-attachment: fixed; /* 使背景图片固定 */
      background-position: center; /* 图片居中 */
      background-repeat: no-repeat; /* 不重复图片 */
      background-size: cover; /* 图片覆盖整个背景 */
    }
    /* 设置表格样式 */
    table {
      width: 80%;
      margin: 50px auto;
      background-color: rgba(255, 255, 255, 0.8); /* 表格背景颜色，半透明 */
      border-collapse: collapse;
    }
    th, td {
      padding: 15px;
      text-align: left;
      border: 1px solid #ddd;
    }
  </style>
</head>
<body>
<h2 align="center">学生信息修改页</h2>
<form action="students?action=update" method="post">
  <table>
    <tr>
      <th><b>学号:</b></th>
      <td><input type="text" name="studentId" value="${student.studentId}" readonly></td>
    </tr>
    <tr>
      <th><b>姓名:</b></th>
      <td><input type="text" name="studentName" value="${student.studentName}"></td>
    </tr>
    <tr>
      <th><b>密码:</b></th>
      <td><input type="password" name="studentPwd" value="${student.studentPwd}"></td>
    </tr>
    <tr>
      <th><b>性别:</b></th>
      <td>
        <input type="radio" name="sex" value="男" ${student.sex == '男' ? 'checked' : ''}> 男
        <input type="radio" name="sex" value="女" ${student.sex == '女' ? 'checked' : ''}> 女
      </td>
    </tr>
    <tr>
      <th><b>班级:</b></th>
      <td>
        <select name="classId">
          <c:forEach items="${classList}" var="clazz">
            <option value="${clazz.classId}" ${student.classId == clazz.classId ? 'selected' : ''}>
                ${clazz.className}
            </option>
          </c:forEach>
        </select>
      </td>
    </tr>
    <tr>
      <th></th>
      <td><input type="submit" value="确认修改"></td>
    </tr>
  </table>
</form>
</body>
</html>